import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
// import App from './App.vue'
// import router from './router'

// Element Plus相关导入
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// Axios相关导入
import axiosHelper from "./axios/axiosHelper"
import App from './App.vue'
import router from './router'
// 创建应用实例
const app = createApp(App)

// 注册Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 使用插件
app.use(ElementPlus, {locale: zhCn})  // 使用ElementPlus并配置中文
app.config.globalProperties.$axios = axiosHelper // 配置全局使用axios
app.use(createPinia())
app.use(router)

// 挂载应用
app.mount('#app')
